Photographing method and apparatus

ABSTRACT

A photographing method includes entering the slow shutter photographing mode, dividing each frame of image of the photographed object into a light trail region, a background light source region, and a non-light-source region, merging the light trail regions of the frames of images, setting a merged light trail region as a light trail region of a target image, setting the background light source regions of one or more of the frames of images as a background light source region of the target image to avoid overexposure, merging the non-light-source regions of one or more of the frames of images, setting a merged non-light-source region as a non-light-source region of the target image to enhance brightness of the non-light-source region, and storing the target image after obtaining a photographing instruction.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Patent ApplicationNo. PCT/CN2016/081263 filed on May 6, 2016, which claims priority toChinese Patent Application No. 201510374860.6 filed on Jun. 30, 2015.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

The present application relates to the field of electroniccommunications technologies, and in particular, to a photographingapparatus and method.

BACKGROUND

With the development of image processing technologies and mobileterminal devices, a mobile apparatus is used as a photographingapparatus anywhere at any time, and this has become an importantfunction commonly used in daily life. People take photos using aphotographing apparatus to conveniently record wonderful moments andexpress feelings. Currently, most photographing apparatuses (forexample, a desktop computer, a mobile phone, a tablet computer, and acamera) provide photographing functions.

A user wishes that a taken photo can effectively reflect a moving trailof a light source for the user, for example, photographing a light-trailpattern that is formed after a handheld light source is moved, a glimpseof fireworks display that easily disappears, or a silky water effectbrought by magnificent waterfalls. Currently, photographing quality of amoving trail of a light source is improved mainly using a slow shutterof a single lens reflex camera mounted on a tripod. However, the singlelens reflex camera is expensive and is not easy to carry, and a screenof the single lens reflex camera becomes dark during photographing. Inthis case, the user needs to have rich photographing experience andneeds to manually adjust photographing parameters according to aphotographing scenario in order to obtain photos having proper exposureand good sharpness. Therefore, based on a current photographingtechnology, the user cannot really and effectively take a high-qualityphoto of a moving trail of a light source, and user experience during aphotographing process needs to be improved.

SUMMARY

Embodiments of the present application provide a photographing methodand apparatus to resolve a problem that a sharp image that is notoverexposed cannot be simply and conveniently taken using variousphotographing apparatuses for a trail formed after a light source ismoved. By means of this solution, a sharp image can be taken simply andconveniently using various photographing apparatus for a trail formedafter a light source is moved.

A first aspect provides a photographing method, including entering theslow shutter photographing mode after obtaining an instruction ofentering a slow shutter photographing mode, continuously obtainingframes of images of a photographed object, dividing each frame of imageof the photographed object into a light trail region, a background lightsource region, and a non-light-source region according to a first presetbrightness value, merging the light trail regions of the frames ofimages of the photographed object, setting the merged light trail regionas a light trail region of a target image, setting the background lightsource regions of one or more of the frames of images of thephotographed object as a background light source region of the targetimage to avoid overexposure of the background light source region of thetarget image, merging the non-light-source regions of one or more of theframes of images of the photographed object, setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and storing the target image afterobtaining a photographing instruction.

In a first possible implementation of the first aspect, aftercontinuously obtaining frames of images of a photographed object, andbefore dividing each frame of image of the photographed object into alight trail region, a background light source region, and anon-light-source region according to a first preset brightness value,the method further includes obtaining brightness of the frames of imagesof the photographed object, obtaining, according to the obtainedbrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in an image of thephotographed object if a value of a parameter needing to be set in theslow shutter photographing mode is not directly obtained, calculating,according to the quantity of the pixels whose brightness is greater thanor equal to the second preset brightness value and a total quantity ofpixels in the image of the photographed object, a percentage value ofthe pixel whose brightness is greater than or equal to the second presetbrightness value, and adjusting, when the percentage value is greaterthan or equal to an upper limit of a preset percentage threshold, thevalue of the parameter needing to be set in the slow shutterphotographing mode to reduce the percentage value such that the reducedpercentage value in the image after the photographing is within a rangeof the preset percentage threshold.

With reference to the first aspect, in a second possible implementation,after continuously obtaining frames of images of a photographed object,and before dividing each frame of image of the photographed object intoa light trail region, a background light source region, and anon-light-source region according to a first preset brightness value,the method further includes obtaining brightness of the frames of imagesof the photographed object, and adjusting, according to the directlyobtained value of the parameter, the parameter needing to be set in theslow shutter photographing mode if a value of a parameter needing to beset in the slow shutter photographing mode is directly obtained, wherethe value of the parameter needing to be set in the slow shutterphotographing mode is set by a user according to the brightness of theimages.

With reference to any one of the first aspect to the second possibleimplementation of the first aspect, in a third possible implementation,after merging the non-light-source regions of one or more of the framesof images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and before storing the target imageafter obtaining a photographing instruction, the method further includesperforming brightness smoothing process on boundaries of the light trailregion, the background light source region, and the non-light-sourceregion.

With reference to any one of the first aspect to the third possibleimplementation of the first aspect, in a fourth possible implementation,adjusting, when the percentage value is greater than or equal to anupper limit of a preset percentage threshold, the value of the parameterneeding to be set in the slow shutter photographing mode to reduce thepercentage value such that the reduced percentage value in the imageafter photographing is within a range of the preset percentage thresholdincludes reducing a value of exposure time and an InternationalOrganization for Standardization (ISO) value when the percentage valueis greater than or equal to the upper limit of the preset percentagethreshold such that the reduced percentage value in the image after thephotographing is within the range of the preset percentage threshold.

With reference to any one of the first aspect to the fourth possibleimplementation of the first aspect, in a fifth possible implementation,dividing each frame of image of the photographed object into a lighttrail region, a background light source region, and a non-light-sourceregion according to a first preset brightness value includes dividingeach frame of image of the photographed object into the light trailregion, the background light source region, and the non-light-sourceregion according to the first preset brightness value, where the lighttrail region is a region in which a difference exists between the framesof images at a same pixel location and a brightness value is greaterthan or equal to the first preset brightness value, the background lightsource region is a region in which no difference exists between theframes of images at a same pixel location and a brightness value isgreater than or equal to the first preset brightness value, and thenon-light-source region is a region in which no difference existsbetween the frames of images at a same pixel location and a brightnessvalue is less than the first preset brightness value.

With reference to any one of the first aspect to the fifth possibleimplementation of the first aspect, in a sixth possible implementation,merging the non-light-source regions of one or more of the frames ofimages of the photographed object, and setting a merged non-light-sourceregion as a non-light-source region of the target image to enhancebrightness of the merged non-light-source region of the target image andavoid overexposure includes merging the non-light-source regions of thefirst N frames of images obtained chronologically in the frames ofimages of the photographed object, adding a brightness value C of themerged non-light-source region and a brightness value of thenon-light-source region of the (N+1)^(th) frame obtained chronologicallyto obtain a brightness value D, and setting the merged non-light-sourceregion of the first N frames of images as the non-light-source region ofthe target image if the brightness value D is greater than or equal tothe first preset brightness value.

A second aspect provides a photographing method, including entering theslow shutter photographing mode after obtaining an instruction ofentering a slow shutter photographing mode, continuously obtainingframes of images of a photographed object, dividing each frame of imageof the photographed object into a light trail region, and anon-light-source region according to a first preset brightness value,merging the light trail regions of the frames of images of thephotographed object, setting the merged light trail region as a lighttrail region of a target image, merging the non-light-source regions ofone or more of the frames of images of the photographed object, settinga merged non-light-source region as a non-light-source region of thetarget image to enhance brightness of the merged non-light-source regionof the target image and avoid overexposure, and storing the target imageafter obtaining a photographing instruction.

In a first possible implementation of the second aspect, aftercontinuously obtaining frames of images of a photographed object, andbefore dividing each frame of image of the photographed object into alight trail region, and a non-light-source region according to a firstpreset brightness value, the method further includes obtainingbrightness of the frames of images of the photographed object,obtaining, according to the obtained brightness, a quantity of pixelswhose brightness is greater than or equal to a second preset brightnessvalue in an image of the photographed object if a value of a parameterneeding to be set in the slow shutter photographing mode is not directlyobtained, calculating, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjusting, when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold, the value of the parameter needing to be set inthe slow shutter photographing mode to reduce the percentage value suchthat the reduced percentage value in the image after photographing iswithin a range of the preset percentage threshold.

With reference to the second aspect, in a second possibleimplementation, after continuously obtaining frames of images of aphotographed object, and before dividing each frame of image of thephotographed object into a light trail region, and a non-light-sourceregion according to a first preset brightness value, the method furtherincludes obtaining brightness of the frames of images of thephotographed object, adjusting, according to the directly obtained valueof the parameter, the parameter needing to be set in the slow shutterphotographing mode if a value of a parameter needing to be set in theslow shutter photographing mode is directly obtained, where the value ofthe parameter needing to be set in the slow shutter photographing modeis set by a user according to the brightness of the images.

With reference to any one of the second aspect to the second possibleimplementation of the second aspect, in a third possible implementation,after merging the non-light-source regions of one or more of the framesof images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and before storing the target imageafter obtaining a photographing instruction, the method further includesperforming brightness smoothing process on boundaries of the light trailregion and the non-light-source region.

With reference to any one of the second aspect to the third possibleimplementation of the second aspect, in a fourth possibleimplementation, adjusting, when the percentage value is greater than orequal to an upper limit of a preset percentage threshold, the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within a range of the presetpercentage threshold includes reducing a value of exposure time and anISO value when the percentage value is greater than or equal to theupper limit of the preset percentage threshold such that the reducedpercentage value in the image after photographing is within the range ofthe preset percentage threshold.

With reference to any one of the second aspect to the fourth possibleimplementation of the second aspect, in a fifth possible implementation,dividing each frame of image of the photographed object into a lighttrail region and a non-light-source region according to a first presetbrightness value includes dividing each frame of image of thephotographed object into the light trail region and the non-light-sourceregion according to the first preset brightness value, where the lighttrail region is a region in which a difference exists between the framesof images at a same pixel location and a brightness value is greaterthan or equal to the first preset brightness value, and thenon-light-source region is a region in which no difference existsbetween the frames of images at a same pixel location and a brightnessvalue is less than the first preset brightness value.

With reference to any one of the second aspect to the fifth possibleimplementation of the second aspect, in a sixth possible implementation,merging the non-light-source regions of one or more of the frames ofimages of the photographed object, and setting a merged non-light-sourceregion as a non-light-source region of the target image to enhancebrightness of the merged non-light-source region of the target image andavoid overexposure includes merging the non-light-source regions of thefirst N frames of images obtained chronologically in the frames ofimages of the photographed object, adding a brightness value C of themerged non-light-source region and a brightness value of thenon-light-source region of the (N+1)^(th) frame obtained chronologicallyto obtain a brightness value D, and setting the merged non-light-sourceregion of the first N frames of images as the non-light-source region ofthe target image if the brightness value D is greater than or equal tothe first preset brightness value.

A third aspect provides a photographing method, including entering theslow shutter photographing mode after obtaining an instruction ofentering a slow shutter photographing mode, continuously obtainingframes of images of a photographed object, dividing each frame of imageof the photographed object into a light trail region, a background lightsource region, and a according to a first preset brightness value,merging the light trail regions of the frames of images of thephotographed object, setting the merged light trail region as a lighttrail region of a target image, setting the background light sourceregions of one or more of the frames of images of the photographedobject as a background light source region of the target image, to avoidoverexposure of the background light source region of the target image,and storing the target image after obtaining a photographinginstruction.

In a first possible implementation of the third aspect, aftercontinuously obtaining frames of images of a photographed object, andbefore the dividing each frame of image of the photographed object intoa light trail region and a background light source region according to afirst preset brightness value, the method further includes obtainingbrightness of the frames of images of the photographed object,obtaining, according to the obtained brightness, a quantity of pixelswhose brightness is greater than or equal to a second preset brightnessvalue in an image of the photographed object if a value of a parameterneeding to be set in the slow shutter photographing mode is not directlyobtained, calculating, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjusting, when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold, the value of the parameter needing to be set inthe slow shutter photographing mode to reduce the percentage value suchthat the reduced percentage value in the image after the photographingis within a range of the preset percentage threshold.

With reference to the third aspect, in a second possible implementation,after continuously obtaining frames of images of a photographed object,and before dividing each frame of image of the photographed object intoa light trail region, a background light source region, and anon-light-source region according to a first preset brightness value,the method further includes obtaining brightness of the frames of imagesof the photographed object, adjusting, according to the directlyobtained value of the parameter, the parameter needing to be set in theslow shutter photographing mode if a value of a parameter needing to beset in the slow shutter photographing mode is directly obtained, wherethe value of the parameter needing to be set in the slow shutterphotographing mode is set by a user according to the brightness of theimages.

With reference to any one of the third aspect to the second possibleimplementation of the third aspect, in a third possible implementation,after setting the background light source regions of one or more of theframes of images of the photographed object as a background light sourceregion of the target image to avoid overexposure of the background lightsource region of the target image, and before storing the target imageafter obtaining a photographing instruction, the method further includesperforming brightness smoothing process on boundaries of the light trailregion and the background light source region.

With reference to any one of the third aspect to the third possibleimplementation of the third aspect, in a fourth possible implementation,adjusting, when the percentage value is greater than or equal to anupper limit of a preset percentage threshold, the value of the parameterneeding to be set in the slow shutter photographing mode to reduce thepercentage value such that the reduced percentage value in the imageafter photographing is within a range of the preset percentage thresholdincludes reducing a value of exposure time and an ISO value when thepercentage value is greater than or equal to the upper limit of thepreset percentage threshold such that the reduced percentage value inthe image after photographing is within the range of the presetpercentage threshold. With reference to any one of the third aspect tothe fourth possible implementation of the third aspect, in a fifthpossible implementation, dividing each frame of image of thephotographed object into a light trail region and a background lightsource region according to a first preset brightness value includesdividing each frame of image of the photographed object into the lighttrail region and the background light source region according to thefirst preset brightness value, where the light trail region is a regionin which a difference exists between the frames of images at a samepixel location and a brightness value is greater than or equal to thefirst preset brightness value, and the background light source region isa region in which no difference exists between the frames of images at asame pixel location and a brightness value is greater than or equal tothe first preset brightness value.

A fourth aspect provides a photographing apparatus, including a firstobtaining module configured to obtain an instruction of entering a slowshutter photographing mode, where the first obtaining module is furtherconfigured to continuously obtain frames of images of a photographedobject after photographing apparatus enters the slow shutterphotographing mode according to the instruction of entering the slowshutter photographing mode, a first processing module configured todivide each frame of image of the photographed object into a light trailregion, a background light source region, and a non-light-source regionaccording to a first preset brightness value, where the first processingmodule is further configured to merge the light trail regions of theframes of images of the photographed object, and set a merged lighttrail region as a light trail region of a target image, the firstprocessing module is further configured to set the background lightsource regions of one or more of the frames of images of thephotographed object as a background light source region of the targetimage to avoid overexposure of the background light source region of thetarget image, and the first processing module is further configured tomerge the non-light-source regions of one or more of the frames ofimages of the photographed object, and set a merged non-light-sourceregion as a non-light-source region of the target image, to enhancebrightness of the merged non-light-source region of the target image andavoid overexposure, and a first photographing module configured to storethe target image after obtaining a photographing instruction.

In a first possible implementation of the fourth aspect, the firstprocessing module is further configured to obtain, according to thebrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in an image of thephotographed object if a value of a parameter needing to be set in theslow shutter photographing mode is not directly obtained, afterbrightness of the frames of images of the photographed object isobtained, calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within a range of the presetpercentage threshold when the percentage value is greater than or equalto an upper limit of a preset percentage threshold.

With reference to the fourth aspect, in a second possibleimplementation, the first processing module is further configured toadjust, according to the directly obtained value of the parameter, theparameter needing to be set in the slow shutter photographing mode ifthe value of the parameter needing to be set in the slow shutterphotographing mode is directly obtained, where the value of theparameter needing to be set in the slow shutter photographing mode isset by a user.

With reference to any one of the fourth aspect to the second possibleimplementation of the fourth aspect, in a third possible implementation,the first processing module is further configured to perform brightnesssmoothing process on boundaries of the light trail region, thebackground light source region, and the non-light-source region.

With reference to any one of the fourth aspect to the third possibleimplementation of the fourth aspect, in a fourth possibleimplementation, when the percentage value is greater than or equal to anupper limit of a preset percentage threshold, when adjusting the valueof the parameter needing to be set in the slow shutter photographingmode to reduce the percentage value such that the reduced percentagevalue in the image after the photographing is within the range of thepreset percentage threshold, the first processing module is furtherconfigured to reduce a value of exposure time and an ISO value when thepercentage value is greater than or equal to the upper limit of thepreset percentage threshold such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold.

With reference to any one of the fourth aspect to the fourth possibleimplementation of the fourth aspect, in a fifth possible implementation,when dividing each frame of image of the photographed object into thelight trail region, the background light source region, and thenon-light-source region according to the first preset brightness value,the first processing module is further configured to divide each frameof image of the photographed object into the light trail region, thebackground light source region, and the non-light-source regionaccording to the first preset brightness value, where the light trailregion is a region in which a difference exists between the frames ofimages at a same pixel location and a brightness value is greater thanor equal to the first preset brightness value, the background lightsource region is a region in which no difference exists between theframes of images at a same pixel location and a brightness value isgreater than or equal to the first preset brightness value, and thenon-light-source region is a region in which no difference existsbetween the frames of images at a same pixel location and a brightnessvalue is less than the first preset brightness value.

With reference to any one of the fourth aspect to the fifth possibleimplementation of the fourth aspect, in a sixth possible implementation,when merging the non-light-source regions of one or more of the framesof images of the photographed object, and setting the mergednon-light-source region as the non-light-source region of the targetimage to enhance the brightness of the merged non-light-source region ofthe target image and avoid overexposure, the first processing module isfurther configured to merge the non-light-source regions of the first Nframes of images obtained chronologically in the frames of images of thephotographed object, add a brightness value C of the mergednon-light-source region and a brightness value of the non-light-sourceregion of the (N+1)^(th) frame obtained chronologically to obtain abrightness value D, and set the merged non-light-source region of thefirst N frames of images as the non-light-source region of the targetimage if the brightness value D is greater than or equal to the firstpreset brightness value, where N is a positive integer.

A fifth aspect provides a photographing apparatus, including a secondobtaining module configured to obtain an instruction of entering a slowshutter photographing mode, where the second obtaining module is furtherconfigured to continuously obtain frames of images of a photographedobject after the photographing apparatus enters the slow shutterphotographing mode according to the instruction of entering the slowshutter photographing mode, a second processing module configured todivide each frame of image of the photographed object into a light trailregion and a background light source region according to a first presetbrightness value, where the second processing module is furtherconfigured to merge the light trail regions of the frames of images ofthe photographed object, and set a merged light trail region as a lighttrail region of a target image, and the second processing module isfurther configured to set the background light source regions of one ormore of the frames of images of the photographed object as a backgroundlight source region of the target image to avoid overexposure of thebackground light source region of the target image, and store the targetimage after obtaining a photographing instruction.

In a first possible implementation of the fifth aspect, the secondprocessing module is further configured to obtain, according to thebrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in an image of thephotographed object if a value of a parameter needing to be set in theslow shutter photographing mode is not directly obtained, afterbrightness of the frames of images of the photographed object isobtained, calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within a range of the presetpercentage threshold when the percentage value is greater than or equalto an upper limit of a preset percentage threshold.

With reference to the fifth aspect, in a second possible implementation,the second processing module is further configured to adjust, accordingto the directly obtained value of the parameter, the parameter needingto be set in the slow shutter photographing mode if the value of theparameter needing to be set in the slow shutter photographing mode isdirectly obtained, where the value of the parameter needing to be set inthe slow shutter photographing mode is set by a user.

With reference to any one of the fifth aspect to the second possibleimplementation of the fifth aspect, in a third possible implementation,the second processing module is further configured to perform brightnesssmoothing process on boundaries of the light trail region and thebackground light source region.

With reference to any one of the fifth aspect to the third possibleimplementation of the fifth aspect, in a fourth possible implementation,when dividing each frame of image of the photographed object into thelight trail region and the background light source region according tothe first preset brightness value, the second processing module isfurther configured to divide each frame of image of the photographedobject into the light trail region and the background light sourceregion according to the first preset brightness value, where the lighttrail region is a region in which a difference exists between the framesof images at a same pixel location and a brightness value is greaterthan or equal to the first preset brightness value, and the backgroundlight source region is a region in which no difference exists betweenthe frames of images at a same pixel location and a brightness value isgreater than or equal to the first preset brightness value.

A sixth aspect provides a photographing method, including a thirdobtaining module configured to obtain an instruction of entering a slowshutter photographing mode, and a third processing module configured toadjust, according to brightness of frames of images of a photographedobject, a value of a parameter needing to be set in the slow shutterphotographing mode to avoid overexposure of a target image after thephotographing, where the third processing module is configured to divideeach frame of image of the photographed object into a light trail regionand a non-light-source region according to a first preset brightnessvalue, and the third processing module is further configured to mergethe light trail regions of the frames of images of the photographedobject, and set a merged light trail region as a light trail region ofthe target image. The third processing module is further configured tomerge the non-light-source regions of one or more of the frames ofimages of the photographed object, and set a merged non-light-sourceregion as a non-light-source region of the target image to enhancebrightness of the merged non-light-source region of the target image andavoid overexposure, and store the target image after obtaining aphotographing instruction.

In a first possible implementation of the sixth aspect, the thirdprocessing module is further configured to obtain, according to thebrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in an image of thephotographed object if the value of the parameter needing to be set inthe slow shutter photographing mode is not directly obtained, after thebrightness of the frames of images of the photographed object isobtained, calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within a range of the presetpercentage threshold when the percentage value is greater than or equalto an upper limit of a preset percentage threshold.

With reference to the sixth aspect, in a second possible implementation,the third processing module is further configured to adjust, accordingto the directly obtained value of the parameter, the parameter needingto be set in the slow shutter photographing mode if the value of theparameter needing to be set in the slow shutter photographing mode isdirectly obtained, where the value of the parameter needing to be set inthe slow shutter photographing mode is set by a user.

With reference to any one of the sixth aspect to the second possibleimplementation of the sixth aspect, in a third possible implementation,the third processing module is further configured to perform brightnesssmoothing process on boundaries of the light trail region and thenon-light-source region.

With reference to any one of the sixth aspect to the third possibleimplementation of the sixth aspect, in a fourth possible implementation,when dividing each frame of image of the photographed object into thelight trail region and the non-light-source region according to thefirst preset brightness value, the third processing module is furtherconfigured to divide each frame of image of the photographed object intothe light trail region and the non-light-source region according to thefirst preset brightness value, where the light trail region is a regionin which a difference exists between the frames of images at a samepixel location and a brightness value is greater than or equal to thefirst preset brightness value, and the non-light-source region is aregion in which no difference exists between the frames of images at asame pixel location and a brightness value is less than the first presetbrightness value.

With reference to any one of the sixth aspect to the fourth possibleimplementation of the sixth aspect, in a fifth possible implementation,when merging the non-light-source regions of one or more of the framesof images of the photographed object, and setting the mergednon-light-source region as the non-light-source region of the targetimage to enhance the brightness of the merged non-light-source region ofthe target image and avoid overexposure, the third processing module isfurther configured to merge the non-light-source regions of the first Nframes of images obtained chronologically in the frames of images of thephotographed object, add a brightness value C of the mergednon-light-source region and a brightness value of the non-light-sourceregion of the (N+1)^(th) frame obtained chronologically to obtain abrightness value D, and set the merged non-light-source region of thefirst N frames of images as the non-light-source region of the targetimage if the brightness value D is greater than or equal to the firstpreset brightness value, where N is a positive integer.

Beneficial effects include each frame of image of a photographed objectis divided into a light trail region, a background light source region,and a non-light-source region, or into a light trail region and abackground light source region, or into a light trail region and anon-light-source region according to a first preset brightness value,and processing of different brightness values is performed for differentregions based on the divided regions such that a user not experienced inphotographing can obtain a high-quality image of a moving trail of alight source through photographing, the obtained image can reflect themoving trail of the light source, and the image is of high sharpness andis not overexposed. For example, using the method or the apparatus,images including effects of a light-trail pattern formed after ahandheld light source is moved, a glimpse of fireworks display thateasily disappears, and a silky water effect brought by magnificentwaterfalls can be obtained simply and conveniently.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentapplication more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments. Theaccompanying drawings in the following description show some embodimentsof the present application, and a person of ordinary skill in the artmay still derive other drawings from these accompanying drawings withoutcreative efforts.

FIG. 1 is a flowchart of Embodiment 1 of a photographing methodaccording to an embodiment of the present application;

FIG. 2 is a flowchart of Embodiment 2 of a photographing methodaccording to an embodiment of the present application;

FIG. 3 is a flowchart of Embodiment 3 of a photographing methodaccording to an embodiment of the present application;

FIG. 4 is a schematic structural diagram of Embodiment 1 of aphotographing apparatus according to an embodiment of the presentapplication;

FIG. 5 is a schematic structural diagram of Embodiment 2 of aphotographing apparatus according to an embodiment of the presentapplication;

FIG. 6 is a schematic structural diagram of Embodiment 3 of aphotographing apparatus according to an embodiment of the presentapplication; and

FIG. 7 is a schematic structural diagram of Embodiment 4 of aphotographing apparatus according to an embodiment of the presentapplication.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of theembodiments of the present application clearer, the following clearlydescribes the technical solutions in the embodiments of the presentapplication with reference to the accompanying drawings in theembodiments of the present application. The described embodiments aresome but not all of the embodiments of the present application. Allother embodiments obtained by a person of ordinary skill in the artbased on the embodiments of the present application without creativeefforts shall fall within the protection scope of the presentapplication.

As shown in FIG. 1, Embodiment 1 of a photographing method according toan embodiment of the present application includes the following steps.

Step S101: After obtaining an instruction of entering a slow shutterphotographing mode, enter the slow shutter photographing mode. Further,a processor of a photographing apparatus obtains, using an input device,the instruction of entering the slow shutter photographing mode that isinput or selected by a user.

Step S102: Continuously obtain frames of images of a photographedobject. Further, after entering the slow shutter photographing mode, theprocessor of the photographing apparatus obtains the frames of images ofthe photographed object at different moments using a camera, anddisplays the frames of images on a screen of the photographingapparatus.

Step S103: Obtain brightness of the frames of images of the photographedobject to adjust a value of a parameter needing to be set in the slowshutter photographing mode in order to avoid overexposure of a targetimage after the photographing. Further, after the brightness of theframes of images is obtained, statistics is collected on a percentage ofa pixel whose brightness is greater than or equal to a particularbrightness value in all pixels, and the percentage value is adjusted toa particular threshold, to adjust overall brightness of the targetimage.

Step S104: Divide each frame of image of the photographed object into alight trail region, a background light source region, and anon-light-source region according to a first preset brightness value,where the light trail region is a region formed by a moving object ofthe photographed object during movement, and includes a trail formed bywaterfalls, a shooting star, or fireworks, the background light sourceregion is another light source region other than the light trail regionof the photographed object, for example, a street lamp or stars, and thenon-light-source region is a region in which there is no light source. Avalue of the first preset brightness value is about 210.

Step S105: Merge the light trail regions of the frames of images of thephotographed object, and set a merged light trail region as a lighttrail region of the target image. Further, brightness of pixels at asame location in the light trail regions of the frames of images isadded, and the added brightness is used as brightness of the mergedlight trail region. Alternatively, brightness of pixels at a samelocation in the light trail regions of some of the frames of images isadded, and the added brightness is used as brightness of the mergedlight trail region.

Step S106: Set the background light source regions of one or more of theframes of images of the photographed object as a background light sourceregion of the target image to avoid overexposure of the background lightsource region of the target image. Further, the background light sourceregion of any one of the frames of images of the photographed object isused as the background light source region of the target image after thephotographing to avoid overexposure of the background light sourceregion of the target image after the photographing. Alternatively, whenthe background light source region of the target image after thephotographing is not overexposed, the background light source regions ofmultiple frames of images of the frames of images of the photographedobject are used as the background light source region of the targetimage after the photographing.

Step S107: Merge the non-light-source regions of one or more of theframes of images of the photographed object, and set a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure. Further, the non-light-sourceregions of the first N frames of images obtained chronologically in theframes of images of the photographed object are merged and the mergednon-light-source region is used as the non-light-source region of thetarget image to enhance brightness of the merged non-light-source regionof the target image and avoid overexposure, where a value of N is apositive integer. Brightness of pixels at a same location in thenon-light-source regions of the first N frames of images is added, andthe added brightness is used as brightness of the mergednon-light-source region, to enhance the brightness, present more detailsof the non-light-source region of the image, and avoid overexposure.Alternatively, the non-light-source region of one of the frames ofimages of the photographed object is used as the non-light-source regionof the target image to enhance the brightness of the mergednon-light-source region of the target image and avoid overexposure.Alternatively, when the non-light-source region of the target imageafter the photographing is not overexposed, the non-light-source regionsof any multiple frames of images of the frames of images of thephotographed object are merged and the merged non-light-source region isused as the non-light-source region of the target image.

Step S108: Store the target image after obtaining a photographinginstruction. Further, for the target image whose light trail region,background light source region, and non-light-source region have beenprocessed, the photographing apparatus stores the target image into amemory after obtaining an instruction of pressing a shutter andexecuting a photographing action. Alternatively, the target imageincluding the light trail region, the background light source region,and the non-light-source region that have been processed by theprocessor is first displayed on the screen of the photographingapparatus for preview, and after an instruction of pressing a shutterand executing a photographing action is obtained, the image that ispreviewed on the screen and is processed is stored into a storagemedium.

Beneficial effects include that each frame of image of a photographedobject is divided into a light trail region, a background light sourceregion, and a non-light-source region according to a first presetbrightness value, and processing of different brightness values isperformed for the three regions such that a user not experienced inphotographing can obtain a high-quality image of a moving trail of alight source through photographing, and the obtained image is ofhigh-quality sharpness and exposure, and can also effectively reflectthe moving trail of the light source. For example, images includingeffects of a light-trail pattern formed after a handheld light source ismoved, a glimpse of fireworks display that easily disappears, and asilky water effect brought by magnificent waterfalls can be obtained bymeans of photographing.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into a light trail region, a background light source region, anda non-light-source region according to a first preset brightness value,the method further includes obtaining the brightness of the frames ofimages of the photographed object, obtaining, according to the obtainedbrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in an image of thephotographed object if the value of the parameter needing to be set inthe slow shutter photographing mode is not directly obtained,calculating, according to the quantity of the pixels whose brightness isgreater than or equal to the second preset brightness value and a totalquantity of pixels in the image of the photographed object, a percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value, and adjusting, when the percentage valueis greater than or equal to an upper limit of a preset percentagethreshold, the value of the parameter needing to be set in the slowshutter photographing mode to reduce the percentage value such that thereduced percentage value in the image is within a range of the presetpercentage threshold.

Beneficial effects include that when the user does not enter the valueof the parameter needing to be set for a slow shutter, the percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value is adjusted to adjust overall brightnessof the image and avoid overexposure of the obtained target image. Thisis an auto-adjustment mode of the photographing apparatus.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into a light trail region, a background light source region, anda non-light-source region according to a first preset brightness value,the method further includes obtaining the brightness of the frames ofimages of the photographed object, and adjusting, according to thedirectly obtained value of the parameter, the parameter needing to beset in the slow shutter photographing mode if the value of the parameterneeding to be set in the slow shutter photographing mode is directlyobtained, where the value of the parameter needing to be set in the slowshutter photographing mode is set by the user according to thebrightness of the images.

Beneficial effects include that when the user-entered value of theparameter needing to be set for the slow shutter is directly obtained,the parameter needing to be set in the slow shutter photographing modeis directly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

Further, after merging the non-light-source regions of one or more ofthe frames of images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and before storing the target imageafter obtaining a photographing instruction, the method further includesperforming brightness smoothing process on boundaries of the light trailregion, the background light source region, and the non-light-sourceregion.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, adjusting, when the percentage value is greater than or equalto an upper limit of a preset percentage threshold, the value of theparameter needing to be set in the slow shutter photographing mode toreduce the percentage value such that the reduced percentage value inthe image after photographing is within a range of the preset percentagethreshold includes reducing a value of exposure time and an ISO valuewhen the percentage value is greater than or equal to the upper limit ofthe preset percentage threshold such that the reduced percentage valuein the image after the photographing is within the range of the presetpercentage threshold.

Beneficial effects include that the parameter needing to be set in theslow shutter photographing mode is set to adjust the overall brightnessof the image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, dividing each frame of image of the photographed object into alight trail region, a background light source region, and anon-light-source region according to a first preset brightness valueincludes dividing each frame of image of the photographed object intothe light trail region, the background light source region, and thenon-light-source region according to a difference degree of the imagesat a same pixel location in the frames of images of the photographedobject and the first preset brightness value, where the differencedegree refers to whether the images at the same pixel location in theframes of images of the photographed object are different.

Further, dividing each frame of image of the photographed object into alight trail region, a background light source region, and anon-light-source region according to a first preset brightness valueincludes dividing each frame of image of the photographed object intothe light trail region, the background light source region, and thenon-light-source region according to the first preset brightness value(about 210), where the light trail region is a region in which adifference exists between the frames of images at a same pixel locationand a brightness value is greater than or equal to the first presetbrightness value (about 210), the background light source region is aregion in which no difference exists between the frames of images at asame pixel location and a brightness value is greater than or equal tothe first preset brightness value (about 210), and the non-light-sourceregion is a region in which no difference exists between the frames ofimages at a same pixel location and a brightness value is less than thefirst preset brightness value (about 210).

Beneficial effects include each frame of image is divided into the lighttrail region, the background light source region, and thenon-light-source region such that the photographing apparatus canseparately perform particular image processing on the regions.

Further, merging the non-light-source regions of one or more of theframes of images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure includes merging thenon-light-source regions of the first N frames of images obtainedchronologically in the frames of images of the photographed object,adding a brightness value C of the merged non-light-source region and abrightness value of the non-light-source region of the (N+1)^(th) frameobtained chronologically to obtain a brightness value D, and setting themerged non-light-source region of the first N frames of images as thenon-light-source region of the target image if the brightness value D isgreater than or equal to the first preset brightness value, where N is apositive integer.

Beneficial effects include selecting frames that are used to form thenon-light-source region of the target image by merging enhances thebrightness of the non-light-source region of the image obtained throughphotographing and avoids overexposure such that details of thenon-light-source region of the image can be presented more effectively.

As shown in FIG. 2, Embodiment 2 of a photographing method according toan embodiment of the present application includes the following steps.

Step S201: After obtaining an instruction of entering a slow shutterphotographing mode, enter the slow shutter photographing mode. Further,a processor of a photographing apparatus obtains, using an input device,the instruction of entering the slow shutter photographing mode that isinput or selected by a user.

Step S202: Continuously obtain frames of images of a photographedobject. Further, after entering the slow shutter photographing mode, theprocessor of the photographing apparatus obtains the frames of images ofthe photographed object at different moments using a camera, anddisplays the frames of images on a screen of the photographingapparatus.

Step S203: Obtain brightness of the frames of images of the photographedobject to adjust a value of a parameter needing to be set in the slowshutter photographing mode in order to avoid overexposure of a targetimage after the photographing. After the brightness of the frames ofimages is obtained, statistics is collected on a percentage of a pixelwhose brightness is greater than or equal to a particular brightnessvalue in all pixels, and the percentage value is adjusted to aparticular threshold, to adjust overall brightness of the target image.

Step S204: Divide each frame of image of the photographed object into alight trail region and a non-light-source region according to a firstpreset brightness value, where the light trail region is a region formedby a moving object of the photographed object during movement, andincludes a trail formed by waterfalls, a shooting star, or fireworks,and the non-light-source region is a region in which there is no lightsource. The first preset brightness value is about 210.

Step S205: Merge the light trail regions of the frames of images of thephotographed object, and set a merged light trail region as a lighttrail region of the target image. Further, brightness of pixels at asame location in the light trail regions of the frames of images isadded, and the added brightness is used as brightness of the mergedlight trail region.

Step S206: Merge the non-light-source regions of one or more of theframes of images of the photographed object, and set a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure. Further, brightness of pixels at asame location in the non-light-source regions of the first N frames ofimages is added, and the added brightness is used as brightness of themerged light trail region to enhance the brightness, present moredetails of the non-light-source region of the image, and avoidoverexposure. Brightness of pixels at a same location in thenon-light-source regions of the first N frames of images is added, andthe added brightness is used as brightness of the merged light trailregion, to enhance the brightness, present more details of thenon-light-source region of the image, and avoid overexposure.Alternatively, the non-light-source region of one of the frames ofimages of the photographed object is merged and is used as thenon-light-source region of the target image, to enhance the brightnessof the merged non-light-source region of the target image and avoidoverexposure. Alternatively, when the non-light-source region of thetarget image after the photographing is not overexposed, thenon-light-source regions of any multiple frames of images of the framesof images of the photographed object are merged and the mergednon-light-source region is used as the non-light-source region of thetarget image.

Step S207: Store the target image after obtaining a photographinginstruction. Further, for the target image whose light trail region andnon-light-source region have been processed, the photographing apparatusstores the target image into a memory after obtaining an instruction ofpressing a shutter and executing a photographing action. Alternatively,the target image including the light trail region, the background lightsource region, and the non-light-source region that have been processedby the processor is first displayed on the screen of the photographingapparatus for preview, and after an instruction of pressing a shutterand executing a photographing action is obtained, the image that ispreviewed on the screen and is processed is stored into a storagemedium.

Beneficial effects include that each frame of image of a photographedobject is divided into a light trail region and a non-light-sourceregion according to a first preset brightness value, and processing ofdifferent brightness values is performed for the two regions such that auser not experienced in photographing can obtain a high-quality image ofa moving trail of a light source through photographing, and the obtainedimage is of high-quality sharpness and exposure, and can alsoeffectively reflect the moving trail of the light source. For example,images including effects of a light-trail pattern formed after ahandheld light source is moved, a glimpse of fireworks display thateasily disappears, and a silky water effect brought by magnificentwaterfalls can be obtained by means of photographing.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into a light trail region and a non-light-source region accordingto a first preset brightness value, the method further includesobtaining the brightness of the frames of images of the photographedobject, obtaining, according to the obtained brightness, a quantity ofpixels whose brightness is greater than or equal to a second presetbrightness value in an image of the photographed object if the value ofthe parameter needing to be set in the slow shutter photographing modeis not directly obtained, calculating, according to the quantity of thepixels whose brightness is greater than or equal to the second presetbrightness value and a total quantity of pixels in the image of thephotographed object, a percentage value of the pixel whose brightness isgreater than or equal to the second preset brightness value, andadjusting, when the percentage value is greater than or equal to anupper limit of a preset percentage threshold, the value of the parameterneeding to be set in the slow shutter photographing mode to reduce thepercentage value such that the reduced percentage value in the image iswithin a range of the preset percentage threshold.

Beneficial effects include when the user does not enter the value of theparameter needing to be set for a slow shutter, the percentage value ofthe pixel whose brightness is greater than or equal to the second presetbrightness value is adjusted to adjust overall brightness of the imageand avoid overexposure of the obtained target image. This is anauto-adjustment mode of the photographing apparatus.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into a light trail region and a non-light-source region accordingto a first preset brightness value, the method further includesobtaining the brightness of the frames of images of the photographedobject, and adjusting, according to the directly obtained value of theparameter, the parameter needing to be set in the slow shutterphotographing mode if the value of the parameter needing to be set inthe slow shutter photographing mode is directly obtained, where thevalue of the parameter needing to be set in the slow shutterphotographing mode is set by the user according to the brightness of theimages.

Beneficial effects include when the user-entered value of the parameterneeding to be set for the slow shutter is directly obtained, theparameter needing to be set in the slow shutter photographing mode isdirectly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

Further, after merging the non-light-source regions of one or more ofthe frames of images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and before storing the target imageafter obtaining a photographing instruction, the method further includesperforming brightness smoothing process on boundaries of the light trailregion and the non-light-source region.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, adjusting, when the percentage value is greater than or equalto an upper limit of a preset percentage threshold, the value of theparameter needing to be set in the slow shutter photographing mode toreduce the percentage value such that the reduced percentage value inthe image is within a range of the preset percentage threshold includesreducing a value of exposure time and an ISO value when the percentagevalue is greater than or equal to the upper limit of the presetpercentage threshold such that the reduced percentage value in the imageis within the range of the preset percentage threshold.

Beneficial effects include the parameter needing to be set in the slowshutter photographing mode is set to adjust the overall brightness ofthe image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, the dividing each frame of image of the photographed objectinto a light trail region and a non-light-source region according to afirst preset brightness value includes dividing each frame of image ofthe photographed object into the light trail region and thenon-light-source region according to the first preset brightness value,where the light trail region is a region in which a difference existsbetween the frames of images at a same pixel location and a brightnessvalue is greater than or equal to the first preset brightness value, andthe non-light-source region is a region in which no difference existsbetween the frames of images at a same pixel location and a brightnessvalue is less than the first preset brightness value.

Beneficial effects include that each frame of image is divided into thelight trail region and the non-light-source region such that thephotographing apparatus can separately perform particular imageprocessing on the regions.

Further, merging the non-light-source regions of one or more of theframes of images of the photographed object, and setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure includes merging thenon-light-source regions of the first N frames of images obtainedchronologically in the frames of images of the photographed object,adding a brightness value C of the merged non-light-source region and abrightness value of the non-light-source region of the (N+1)^(th) frameobtained chronologically to obtain a brightness value D, and setting themerged non-light-source region of the first N frames of images as thenon-light-source region of the target image if the brightness value D isgreater than or equal to the first preset brightness value.

Beneficial effects include selecting frames that are used to form thenon-light-source region of the target image by merging enhances thebrightness of the non-light-source region of the image obtained throughphotographing and avoids overexposure such that details of thenon-light-source region of the image can be presented more effectively.

As shown in FIG. 3, Embodiment 3 of a photographing method according toan embodiment of the present application includes the following steps.

Step S301: After obtaining an instruction of entering a slow shutterphotographing mode, enter the slow shutter photographing mode. Further,a processor of a photographing apparatus obtains, using an input device,the instruction of entering the slow shutter photographing mode that isinput or selected by a user.

Step S302: Continuously obtain frames of images of a photographedobject. Further, after entering the slow shutter photographing mode, theprocessor of the photographing apparatus obtains the frames of images ofthe photographed object at different moments using a camera, anddisplays the frames of images on a screen of the photographingapparatus.

Step S303: Obtain brightness of the frames of images of the photographedobject to adjust a value of a parameter needing to be set in the slowshutter photographing mode in order to avoid overexposure of a targetimage after the photographing. Further, after the brightness of theframes of images is obtained, statistics is collected on a percentage ofa pixel whose brightness is greater than or equal to a particularbrightness value in all pixels, and the percentage value is adjusted toa particular threshold to adjust overall brightness of the target image.

Step S304: Divide each frame of image of the photographed object into alight trail region and a background light source region according to afirst preset brightness value, where the light trail region is a regionformed by a moving object of the photographed object during movement,and includes a trail formed by waterfalls, a shooting star, orfireworks, and the background light source is another light sourceregion other than the light trail region of the photographed object, forexample, a street lamp or stars. A value of the first preset brightnessvalue is about 210.

Step S305: Merge the light trail regions of the frames of images of thephotographed object, and set a merged light trail region as a lighttrail region of the target image.

Further, brightness of pixels at a same location in the light trailregions of the frames of images is added, and the added brightness isused as brightness of the merged light trail region.

Step S306: Set the background light source regions of one or more of theframes of images of the photographed object as a background light sourceregion of the target image to avoid overexposure of the background lightsource region of the target image.

Step S307: Store the target image after obtaining a photographinginstruction. Further, for the target image whose light trail region andbackground light source region have been processed, the photographingapparatus stores the target image into a memory after obtaining aninstruction of pressing a shutter and executing a photographing action.Alternatively, the target image including the light trail region, thebackground light source region, and the non-light-source region thathave been processed by the processor is first displayed on the screen ofthe photographing apparatus for preview, and after an instruction ofpressing a shutter and executing a photographing action is obtained, theimage that is previewed on the screen and is processed is stored into astorage medium.

Beneficial effects include that each frame of image of a photographedobject is divided into a light trail region and a background lightsource region according to a first preset brightness value, andprocessing of different brightness values is performed for the tworegions such that a user not experienced in photographing can obtain ahigh-quality image of a moving trail of a light source throughphotographing, and the obtained image is of high-quality sharpness andexposure, and can also effectively reflect the moving trail of the lightsource. For example, images including effects of a light-trail patternformed after a handheld light source is moved, a glimpse of fireworksdisplay that easily disappears, and a silky water effect brought bymagnificent waterfalls can be obtained by means of photographing.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into light trail region and background light source regionaccording to a first preset brightness value, the method furtherincludes obtaining the brightness of the frames of images of thephotographed object, obtaining, according to the obtained brightness, aquantity of pixels whose brightness is greater than or equal to a secondpreset brightness value in an image of the photographed object if thevalue of the parameter needing to be set in the slow shutterphotographing mode is not directly obtained, calculating, according tothe quantity of the pixels whose brightness is greater than or equal tothe second preset brightness value and a total quantity of pixels in theimage of the photographed object, a percentage value of the pixel whosebrightness is greater than or equal to the second preset brightnessvalue, and adjusting, when the percentage value is greater than or equalto an upper limit of a preset percentage threshold, the value of theparameter needing to be set in the slow shutter photographing mode toreduce the percentage value such that the reduced percentage value inthe image is within a range of the preset percentage threshold.

Beneficial effects include that when the user does not enter the valueof the parameter needing to be set for a slow shutter, the percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value is adjusted to adjust overall brightnessof the image and avoid overexposure of the obtained target image. Thisis an auto-adjustment mode of the photographing apparatus.

Further, after continuously obtaining frames of images of a photographedobject, and before dividing each frame of image of the photographedobject into light trail region and background light source regionaccording to a first preset brightness value, the method furtherincludes obtaining the brightness of the frames of images of thephotographed object, and adjusting, according to the directly obtainedvalue of the parameter, the parameter needing to be set in the slowshutter photographing mode if the value of the parameter needing to beset in the slow shutter photographing mode is directly obtained, wherethe value of the parameter needing to be set in the slow shutterphotographing mode is set by the user according to the brightness of theimages.

Beneficial effects include that when the user-entered value of theparameter needing to be set for the slow shutter is directly obtained,the parameter needing to be set in the slow shutter photographing modeis directly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

Further, after setting the background light source regions of one ormore of the frames of images of the photographed object as a backgroundlight source region of the target image to avoid overexposure of thebackground light source region of the target image, and before storingthe target image after obtaining a photographing instruction, the methodfurther includes performing brightness smoothing process on boundariesof the light trail region and the background light source region.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, adjusting, when the percentage value is greater than or equalto an upper limit of a preset percentage threshold, the value of theparameter needing to be set in the slow shutter photographing mode toreduce the percentage value such that the reduced percentage value inthe image is within a range of the preset percentage threshold includesreducing a value of exposure time and an ISO value when the percentagevalue is greater than or equal to the upper limit of the presetpercentage threshold such that the reduced percentage value in the imageis within the range of the preset percentage threshold.

Beneficial effects include that the parameter needing to be set in theslow shutter photographing mode is set to adjust the overall brightnessof the image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, dividing each frame of image of the photographed object into alight trail region and a background light source region according to afirst preset brightness value includes dividing each frame of image ofthe photographed object into the light trail region and the backgroundlight source region according to the first preset brightness value,where the light trail region is a region in which a difference existsbetween the frames of images at a same pixel location and a brightnessvalue is greater than or equal to the first preset brightness value, andthe background light source region is a region in which no differenceexists between the frames of images at a same pixel location and abrightness value is greater than or equal to the first preset brightnessvalue.

Beneficial effects include that each frame of image is divided into thelight trail region and the background light source region such that thephotographing apparatus can separately perform particular imageprocessing on the regions.

As shown in FIG. 4, FIG. 4 is a schematic structural diagram ofEmbodiment 1 of a photographing apparatus according to an embodiment ofthe present application. The photographing apparatus includes a firstobtaining module 41, a first processing module 42, and a firstphotographing module 43.

The first obtaining module 41 is configured to obtain an instruction ofentering a slow shutter photographing mode. Further, a processor (notshown) of the photographing apparatus obtains, using an input device(not shown), the instruction of entering the slow shutter photographingmode that is input or selected by a user.

The first obtaining module 41 is further configured to continuouslyobtain frames of images of a photographed object after the photographingapparatus enters the slow shutter photographing mode according to theinstruction of entering the slow shutter photographing mode. Further,after entering the slow shutter photographing mode, the processor of thephotographing apparatus obtains the frames of images of the photographedobject at different moments using a camera (not shown), and displays theframes of images on a screen of the photographing apparatus.

The first obtaining module 41 is further configured to obtain brightnessof the frames of images of the photographed object to adjust a value ofa parameter needing to be set in the slow shutter photographing mode.

The first processing module 42 is configured to adjust, according to thebrightness of the frames of images of the photographed object, the valueof the parameter needing to be set in the slow shutter photographingmode in order to avoid overexposure of a target image after thephotographing. Further, after the brightness of the frames of images isobtained, statistics is collected on a percentage of a pixel whosebrightness is greater than or equal to a particular brightness value inall pixels, and the percentage value is adjusted to a particularthreshold to adjust overall brightness of the target image.

The first processing module 42 is configured to divide each frame ofimage of the photographed object into a light trail region, a backgroundlight source region, and a non-light-source region according to a firstpreset brightness value, where the light trail region is a region formedby a moving object of the photographed object during movement, andincludes a trail formed by waterfalls, a shooting star, or fireworks,the background light source is another light source region other thanthe light trail region of the photographed object, for example, a streetlamp or stars, and the non-light-source region is a region in whichthere is no light source. A value of the first preset brightness valueis about 210.

The first processing module 42 is further configured to merge the lighttrail regions of the frames of images of the photographed object, andset a merged light trail region as a light trail region of the targetimage.

Further, brightness of pixels at a same location in the light trailregions of the frames of images is added, and the added brightness isused as brightness of the merged light trail region. Alternatively,brightness of pixels at a same location in the light trail regions ofsome of the frames of images is added, and the added brightness is usedas brightness of the merged light trail region.

The first processing module 42 is further configured to set thebackground light source regions of one or more of the frames of imagesof the photographed object as a background light source region of thetarget image to avoid overexposure of the background light source regionof the target image. Further, the background light source region of anyone of the frames of images of the photographed object is used as thebackground light source region of the target image after thephotographing to avoid overexposure of the background light sourceregion of the target image after the photographing. Alternatively, whenthe background light source region of the target image after thephotographing is not overexposed, the background light source regions ofmultiple frames of images of the frames of images of the photographedobject are used as the background light source region of the targetimage after the photographing.

The first processing module 42 is further configured to merge thenon-light-source regions of one or more of the frames of images of thephotographed object, and set a merged non-light-source region as anon-light-source region of the target image to enhance brightness of themerged non-light-source region of the target image and avoidoverexposure.

Further, the non-light-source regions of the first N frames of imagesobtained chronologically in the frames of images of the photographedobject are merged and the merged non-light-source region is used as thenon-light-source region of the target image to enhance brightness of themerged non-light-source region of the target image and avoidoverexposure, where a value of N is a positive integer. Brightness ofpixels at a same location in the non-light-source regions of the first Nframes of images is added, and the added brightness is used asbrightness of the merged light trail region, to enhance the brightness,present more details of the non-light-source region of the image, andavoid overexposure. Alternatively, the non-light-source region of one ofthe frames of images of the photographed object is merged and is used asthe non-light-source region of the target image to enhance thebrightness of the merged non-light-source region of the target image andavoid overexposure. Alternatively, when the non-light-source region ofthe target image after the photographing is not overexposed, thenon-light-source regions of any multiple frames of images of the framesof images of the photographed object are merged and the mergednon-light-source region is used as the non-light-source region of thetarget image.

The first photographing module 43 is configured to store the targetimage after obtaining a photographing instruction. Further, for thetarget image whose light trail region, background light source region,and non-light-source region have been processed, the photographingapparatus stores the target image into a memory after obtaining aninstruction of pressing a shutter and executing a photographing action.Alternatively, the target image including the light trail region, thebackground light source region, and the non-light-source region thathave been processed by the processor is first displayed on the screen ofthe photographing apparatus for preview, and after an instruction ofpressing a shutter and executing a photographing action is obtained, theimage that is previewed on the screen and is processed is stored into astorage medium.

Beneficial effects include that each frame of image of a photographedobject is divided into a light trail region, a background light sourceregion, and a non-light-source region according to a first presetbrightness value, and processing of different brightness values isperformed for different regions such that a user not experienced inphotographing can obtain a high-quality image of a moving trail of alight source through photographing, and the obtained image is ofhigh-quality sharpness and exposure, and can also effectively reflectthe moving trail of the light source. For example, images includingeffects of a light-trail pattern formed after a handheld light source ismoved, a glimpse of fireworks display that easily disappears, and asilky water effect brought by magnificent waterfalls can be obtained bymeans of photographing.

The first processing module 42 is further configured to obtain,according to the brightness, a quantity of pixels whose brightness isgreater than or equal to a second preset brightness value in an image ofthe photographed object if the value of the parameter needing to be setin the slow shutter photographing mode is not directly obtained, afterthe brightness of the frames of images of the photographed object isobtained, calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image is within a range of the preset percentage threshold when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold.

Beneficial effects include that when the user does not enter the valueof the parameter needing to be set for a slow shutter, the percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value is adjusted to adjust overall brightnessof the image and avoid overexposure of the obtained target image. Thisis an auto-adjustment mode of the photographing apparatus.

Further, the first processing module 42 is further configured to adjust,according to the directly obtained value of the parameter, the parameterneeding to be set in the slow shutter photographing mode if the value ofthe parameter needing to be set in the slow shutter photographing modeis directly obtained, where the value of the parameter needing to be setin the slow shutter photographing mode is set by the user.

Beneficial effects include that when the user-entered value of theparameter needing to be set for the slow shutter is directly obtained,the parameter needing to be set in the slow shutter photographing modeis directly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

Further, the first processing module 42 is further configured to performbrightness smoothing process on boundaries of the light trail region,the background light source region, and the non-light-source region.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, when the percentage value is greater than or equal to the upperlimit of the preset percentage threshold, when adjusting the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold, the first processing module 42 is furtherconfigured to reduce a value of exposure time and an ISO value when thepercentage value is greater than or equal to the upper limit of thepreset percentage threshold such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold.

Beneficial effects include that the parameter needing to be set in theslow shutter photographing mode is set to adjust the overall brightnessof the image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, when dividing each frame of image of the photographed objectinto the light trail region, the background light source region, and thenon-light-source region according to the first preset brightness value,the first processing module 42 is further configured to divide eachframe of image of the photographed object into the light trail region,the background light source region, and the non-light-source regionaccording to a difference degree of the images at a same pixel locationin the frames of images of the photographed object and the first presetbrightness value, where the difference degree refers to whether theimages at the same pixel location in the frames of images of thephotographed object are different.

Further, when dividing each frame of image of the photographed objectinto the light trail region, the background light source region, and thenon-light-source region according to the first preset brightness value,the first processing module 42 is further configured to divide eachframe of image of the photographed object into the light trail region,the background light source region, and the non-light-source regionaccording to the first preset brightness value (about 210), where thelight trail region is a region in which a difference exists between theframes of images at a same pixel location and a brightness value isgreater than or equal to the first preset brightness value (about 210),the background light source region is a region in which no differenceexists between the frames of images at a same pixel location and abrightness value is greater than or equal to the first preset brightnessvalue (about 210), and the non-light-source region is a region in whichno difference exists between the frames of images at a same pixellocation and a brightness value is less than the first preset brightnessvalue (about 210).

Beneficial effects include that each frame of image is divided into thelight trail region, the background light source region, and thenon-light-source region such that the photographing apparatus canseparately perform particular image processing on the regions.

Further, when merging the non-light-source regions of one or more of theframes of images of the photographed object, and setting the mergednon-light-source region as the non-light-source region of the targetimage to enhance the brightness of the merged non-light-source region ofthe target image and avoid overexposure, the first processing module 42is further configured to merge the non-light-source regions of the firstN frames of images obtained chronologically in the frames of images ofthe photographed object, add a brightness value C of the mergednon-light-source region and a brightness value of the non-light-sourceregion of the (N+1)^(th) frame obtained chronologically to obtain abrightness value D, and set the merged non-light-source region of thefirst N frames of images as the non-light-source region of the targetimage if the brightness value D is greater than or equal to the firstpreset brightness value, where N is a positive integer.

Beneficial effects include selecting frames that are used to form thenon-light-source region of the target image by merging enhances thebrightness of the non-light-source region of the image obtained throughphotographing and avoids overexposure such that details of thenon-light-source region of the image can be presented more effectively.

As shown in FIG. 5, FIG. 5 is a schematic structural diagram ofEmbodiment 2 of a photographing apparatus according to an embodiment ofthe present application. The photographing apparatus includes a secondobtaining module 51, a second processing module 52, and a secondphotographing module 53.

The second obtaining module 51 is configured to obtain an instruction ofentering a slow shutter photographing mode. Further, a processor (notshown) of the photographing apparatus obtains, using an input device(not shown), the instruction of entering the slow shutter photographingmode that is input or selected by a user.

The second obtaining module 51 is further configured to continuouslyobtain frames of images of a photographed object after the photographingapparatus enters the slow shutter photographing mode according to theinstruction of entering the slow shutter photographing mode. Further,after entering the slow shutter photographing mode, the processor of thephotographing apparatus obtains the frames of images of the photographedobject at different moments using a camera (not shown), and displays theframes of images on a screen of the photographing apparatus.

The second obtaining module 51 is further configured to obtainbrightness of the frames of images of the photographed object to adjusta value of a parameter needing to be set in the slow shutterphotographing mode.

The second processing module 52 is configured to adjust, according tothe brightness of the frames of images of the photographed object, thevalue of the parameter needing to be set in the slow shutterphotographing mode in order to avoid overexposure of a target imageafter the photographing. Further, after the brightness of the frames ofimages is obtained, statistics is collected on a percentage of a pixelwhose brightness is greater than or equal to a particular brightnessvalue in all pixels, and the percentage value is adjusted to aparticular threshold, to adjust overall brightness of the target image.

The second processing module 52 is configured to divide each frame ofimage of the photographed object into a light trail region and abackground light source region according to a first preset brightnessvalue, where the light trail region is a region formed by a movingobject of the photographed object during movement, and includes a trailformed by waterfalls, a shooting star, or fireworks, and the backgroundlight source is another light source region other than the light trailregion of the photographed object, for example, a street lamp or stars.A value of the first preset brightness value is about 210.

The second processing module 52 is further configured to merge the lighttrail regions of the frames of images of the photographed object, anduse a merged light trail region as a light trail region of the targetimage. Further, brightness of pixels at a same location in the lighttrail regions of the frames of images is added, and the added brightnessis used as brightness of the merged light trail region. Alternatively,brightness of pixels at a same location in the light trail regions ofsome of the frames of images is added, and the added brightness is usedas brightness of the merged light trail region.

The second processing module 52 is further configured to set thebackground light source regions of one or more of the frames of imagesof the photographed object as a background light source region of thetarget image to avoid overexposure of the background light source regionof the target image. Further, the background light source region of anyone of the frames of images of the photographed object is used as thebackground light source region of the target image after thephotographing to avoid overexposure of the background light sourceregion of the target image after the photographing. Alternatively, whenthe background light source region of the target image afterphotographing is not overexposed, the background light source regions ofmultiple frames of images of the frames of images of the photographedobject are used as the background light source region of the targetimage after the photographing.

The second photographing module 53 stores the target image afterobtaining a photographing instruction. Further, for the target imagewhose light trail region, background light source region, andnon-light-source region have been processed, the photographing apparatusstores the target image into a memory after obtaining an instruction ofpressing a shutter and executing a photographing action. Alternatively,the target image including the light trail region, the background lightsource region, and the non-light-source region that have been processedby the processor is first displayed on the screen of the photographingapparatus for preview, and after an instruction of pressing a shutterand executing a photographing action is obtained, the image that ispreviewed on the screen and is processed is stored into a storagemedium. Beneficial effects include that each frame of image of aphotographed object is divided into light trail region and backgroundlight source region according to a first preset brightness value, andprocessing of different brightness values is performed for the tworegions such that a user not experienced in photographing can obtain ahigh-quality image of a moving trail of a light source throughphotographing, and the obtained image is of high-quality sharpness andexposure, and can also effectively reflect the moving trail of the lightsource. For example, images including effects of a light-trail patternformed after a handheld light source is moved, a glimpse of fireworksdisplay that easily disappears, and a silky water effect brought bymagnificent waterfalls can be obtained by means of photographing.

Further, the second processing module 52 is further configured toobtain, according to the brightness, a quantity of pixels whosebrightness is greater than or equal to a second preset brightness valuein an image of the photographed object if the value of the parameterneeding to be set in the slow shutter photographing mode is not directlyobtained, after the brightness of the frames of images of thephotographed object is obtained, calculate, according to the quantity ofthe pixels whose brightness is greater than or equal to the secondpreset brightness value and a total quantity of pixels in the image ofthe photographed object, a percentage value of the pixel whosebrightness is greater than or equal to the second preset brightnessvalue, and adjust the value of the parameter needing to be set in theslow shutter photographing mode to reduce the percentage value such thatthe reduced percentage value in the image is within a range of thepreset percentage threshold when the percentage value is greater than orequal to an upper limit of a preset percentage threshold.

Beneficial effects include that when the user does not enter the valueof the parameter needing to be set for a slow shutter, the percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value is adjusted to adjust overall brightnessof the image and avoid overexposure of the obtained target image. Thisis an auto-adjustment mode of the photographing apparatus.

The second processing module 52 is further configured to adjust,according to the directly obtained value of the parameter, the parameterneeding to be set in the slow shutter photographing mode if the value ofthe parameter needing to be set in the slow shutter photographing modeis directly obtained, where the value of the parameter needing to be setin the slow shutter photographing mode is set by the user.

Beneficial effects include that when the user-entered value of theparameter needing to be set for the slow shutter is directly obtained,the parameter needing to be set in the slow shutter photographing modeis directly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

The second processing module 52 is further configured to performbrightness smoothing process on boundaries of the light trail region andthe non-light-source region.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, when the percentage value is greater than or equal to the upperlimit of the preset percentage threshold, when adjusting the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold, the second processing module 52 is furtherconfigured to reduce a value of exposure time and an ISO value when thepercentage value is greater than or equal to the upper limit of thepreset percentage threshold such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold.

Beneficial effects include that the parameter needing to be set in theslow shutter photographing mode is set to adjust the overall brightnessof the image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, when dividing each frame of image of the photographed objectinto the light trail region and the background light source regionaccording to the first preset brightness value, the second processingmodule 52 is further configured to divide each frame of image of thephotographed object into the light trail region and the background lightsource region according to the first preset brightness value (about210), where the light trail region is a region in which a differenceexists between the frames of images at a same pixel location and abrightness value is greater than or equal to the first preset brightnessvalue (about 210), and the background light source region is a region inwhich no difference exists between the frames of images at a same pixellocation and a brightness value is greater than or equal to the firstpreset brightness value (about 210).

Beneficial effects include that each frame of image is divided into thelight trail region and the background light source region such that thephotographing apparatus can separately perform particular imageprocessing on the regions.

As shown in FIG. 6, FIG. 6 is a schematic structural diagram ofEmbodiment 3 of a photographing apparatus according to an embodiment ofthe present application. The photographing apparatus includes a thirdobtaining module 61, a third processing module 62, and a thirdphotographing module 63.

The third obtaining module 61 is configured to obtain an instruction ofentering a slow shutter photographing mode. Further, a processor (notshown) of the photographing apparatus obtains, using an input device(not shown), the instruction of entering the slow shutter photographingmode that is input or selected by a user.

The third obtaining module 61 is further configured to continuouslyobtain frames of images of a photographed object after the photographingapparatus enters the slow shutter photographing mode according to theinstruction of entering the slow shutter photographing mode. Further,after entering the slow shutter photographing mode, the processor of thephotographing apparatus obtains the frames of images of the photographedobject at different moments using a camera (not shown), and displays theframes of images on a screen of the photographing apparatus.

The third obtaining module 61 is further configured to obtain brightnessof the frames of images of the photographed object to adjust a value ofa parameter needing to be set in the slow shutter photographing mode.

The third processing module 62 is configured to adjust, according to thebrightness of the frames of images of the photographed object, the valueof the parameter needing to be set in the slow shutter photographingmode in order to avoid overexposure of a target image after thephotographing. Further, after the brightness of the frames of images isobtained, statistics is collected on a percentage of a pixel whosebrightness is greater than or equal to a particular brightness value inall pixels, and the percentage value is adjusted to a particularthreshold to adjust overall brightness of the target image.

The third processing module 62 divides each frame of image of thephotographed object into a light trail region and a non-light-sourceregion according to a first preset brightness value, where the lighttrail region is a region formed by a moving object of the photographedobject during movement, and includes a trail formed by waterfalls, ashooting star, or fireworks, and the non-light-source region is a regionin which there is no light source.

The third processing module 62 is further configured to merge the lighttrail regions of the frames of images of the photographed object, andset a merged light trail region as a light trail region of the targetimage. Further, brightness of pixels at a same location in the lighttrail regions of the frames of images is added, and the added brightnessis used as brightness of the merged light trail region. Alternatively,brightness of pixels at a same location in the light trail regions ofsome of the frames of images is added, and the added brightness is usedas brightness of the merged light trail region.

The third processing module 62 is further configured to merge thenon-light-source regions of one or more of the frames of images of thephotographed object, and set a merged non-light-source region as anon-light-source region of the target image to enhance brightness of themerged non-light-source region of the target image and avoidoverexposure.

Further, the non-light-source regions of the first N frames of imagesobtained chronologically in the frames of images of the photographedobject are merged and the merged non-light-source region is used as thenon-light-source region of the target image to enhance brightness of themerged non-light-source region of the target image and avoidoverexposure, where a value of N is a positive integer. Brightness ofpixels at a same location in the non-light-source regions of the first Nframes of images is added, and the added brightness is used asbrightness of the merged light trail region to enhance the brightness,present more details of the non-light-source region of the image, andavoid overexposure. Alternatively, the non-light-source region of one ofthe frames of images of the photographed object is merged and is used asthe non-light-source region of the target image to enhance brightness ofthe merged non-light-source region of the target image and avoidoverexposure. Alternatively, when the non-light-source region of thetarget image after the photographing is not overexposed, thenon-light-source regions of any multiple frames of images of the framesof images of the photographed object are merged and the mergednon-light-source region is used as the non-light-source region of thetarget image.

The third photographing module 63 stores the target image afterobtaining a photographing instruction. Further, for the target imagewhose light trail region and non-light-source region have beenprocessed, the photographing apparatus stores the target image into amemory after obtaining an instruction of pressing a shutter andexecuting a photographing action. Alternatively, the target imageincluding the light trail region and the non-light-source region thathave been processed by the processor is first displayed on the screen ofthe photographing apparatus for preview, and after an instruction ofpressing a shutter and executing a photographing action is obtained, theimage that is previewed on the screen and is processed is stored into astorage medium. Beneficial effects include that each frame of image of aphotographed object is divided into a light trail region and anon-light-source region according to a first preset brightness value,and processing of different brightness values is performed for the tworegions such that a user not experienced in photographing can obtain ahigh-quality image of a moving trail of a light source throughphotographing, and the obtained image is of high-quality sharpness andexposure, and can also effectively reflect the moving trail of the lightsource. For example, images including effects of a light-trail patternformed after a handheld light source is moved, a glimpse of fireworksdisplay that easily disappears, and a silky water effect brought bymagnificent waterfalls can be obtained by means of photographing.

The third processing module 62 is further configured to obtain,according to the brightness, a quantity of pixels whose brightness isgreater than or equal to a second preset brightness value in an image ofthe photographed object if the value of the parameter needing to be setin the slow shutter photographing mode is not directly obtained, afterthe brightness of the frames of images of the photographed object isobtained, calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value, and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image is within a range of the preset percentage threshold when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold.

Beneficial effects include that when the user does not enter the valueof the parameter needing to be set for a slow shutter, the percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value is adjusted to adjust overall brightnessof the image and avoid overexposure of the obtained target image. Thisis an auto-adjustment mode of the photographing apparatus.

Further, the third processing module 62 is further configured to adjust,according to the directly obtained value of the parameter, the parameterneeding to be set in the slow shutter photographing mode if the value ofthe parameter needing to be set in the slow shutter photographing modeis directly obtained, where the value of the parameter needing to be setin the slow shutter photographing mode is set by a user.

Beneficial effects include that when the user-entered value of theparameter needing to be set for the slow shutter is directly obtained,the parameter needing to be set in the slow shutter photographing modeis directly set to adjust the overall brightness of the image and avoidoverexposure of the obtained target image. This is a manual adjustmentmode.

The third processing module 62 is further configured to performbrightness smoothing process on boundaries of the light trail region andthe background light source region.

Beneficial effects include that brightness smoothing process isperformed on the boundaries such that the brightness of the imagechanges gently.

Further, when the percentage value is greater than or equal to the upperlimit of the preset percentage threshold, when adjusting the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image after the photographing is within the range of the presetpercentage threshold, the third processing module 62 is furtherconfigured to reduce a value of exposure time and an ISO value when thepercentage value is greater than or equal to the upper limit of thepreset percentage threshold (any percentage from 20% to 30%) such thatthe reduced percentage value in the image after the photographing iswithin the range of the preset percentage threshold.

Beneficial effects include that parameter needing to be set in the slowshutter photographing mode is set to adjust the overall brightness ofthe image, and the value of the exposure time and the ISO value arereduced to avoid overexposure of the obtained target image.

Further, when dividing each frame of image of the photographed objectinto the light trail region and the non-light-source region according tothe first preset brightness value, the third processing module 62 isfurther configured to divide each frame of image of the photographedobject into the light trail region and the non-light-source regionaccording to the first preset brightness value (about 210), where thelight trail region is a region in which a difference exists between theframes of images at a same pixel location and a brightness value isgreater than or equal to the first preset brightness value (about 210),and the non-light-source region is a region in which no differenceexists between the frames of images at a same pixel location and abrightness value is less than the first preset brightness value (about210).

Beneficial effects include that each frame of image is divided into thelight trail region and the non-light-source region such that thephotographing apparatus can separately perform particular imageprocessing on the regions.

When merging the non-light-source regions of one or more of the framesof images of the photographed object, and setting the mergednon-light-source region as the non-light-source region of the targetimage to enhance the brightness of the merged non-light-source region ofthe target image and avoid overexposure, the third processing module 62is further configured to merge the non-light-source regions of the firstN frames of images obtained chronologically in the frames of images ofthe photographed object, add a brightness value C of the mergednon-light-source region and a brightness value of the non-light-sourceregion of the (N+1)^(th) frame obtained chronologically to obtain abrightness value D, and set the merged non-light-source region of thefirst N frames of images as the non-light-source region of the targetimage if the brightness value D is greater than or equal to the firstpreset brightness value, where N is a positive integer.

Further, the non-light-source regions of the first N frames of imagesobtained chronologically in the frames of images of the photographedobject are merged and the merged non-light-source region is used as thenon-light-source region of the target image to enhance brightness of themerged non-light-source region of the target image and avoidoverexposure, where a value of N is a positive integer. Brightness ofpixels at a same location in the non-light-source regions of the first Nframes of images is added, and the added brightness is used asbrightness of the merged non-light-source region to enhance thebrightness, present more details of the non-light-source region of theimage, and avoid overexposure. Alternatively, the non-light-sourceregion of one of the frames of images of the photographed object ismerged and is used as the non-light-source region of the target image toenhance brightness of the merged non-light-source region of the targetimage and avoid overexposure. Alternatively, when the non-light-sourceregion of the target image after the photographing is not overexposed,the non-light-source regions of any multiple frames of images of theframes of images of the photographed object are merged and the mergednon-light-source region is used as the non-light-source region of thetarget image.

As shown in FIG. 7, FIG. 7 is a schematic structural diagram ofEmbodiment 4 of a photographing apparatus 700 according to an embodimentof the present application. The photographing apparatus 700 includes acamera 701 configured to continuously obtain frames of images of aphotographed object after the photographing apparatus enters a slowshutter photographing mode according to an instruction of entering theslow shutter photographing mode, a processor 702 configured to divideeach frame of image of the photographed object into a light trailregion, a background light source region, and a non-light-source regionaccording to a first preset brightness value, where the processor 702 isfurther configured to merge the light trail regions of the frames ofimages of the photographed object, and set a merged light trail regionas a light trail region of a target image, and the processor 702 isfurther configured to set the background light source regions of one ormore of the frames of images of the photographed object as a backgroundlight source region of the target image to avoid overexposure of thebackground light source region of the target image, and furtherconfigured to merge the non-light-source regions of one or more of theframes of images of the photographed object, and set a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure, and a memory 703 configured tostore data, and further, store various image data during photographingand after executing a photographing action.

The foregoing hardware units may transmit data using a data channel.

Finally, it should be noted that the foregoing embodiments are merelyintended for describing the technical solutions of the presentapplication, but not for limiting the present application. Although thepresent application is described in detail with reference to theforegoing embodiments, persons of ordinary skill in the art shouldunderstand that they may still make modifications to the technicalsolutions described in the foregoing embodiments or make equivalentreplacements to some or all technical features thereof, withoutdeparting from the scope of the technical solutions of the embodimentsof the present application.

What is claimed is:
 1. A photographing method, comprising: entering aslow shutter photographing mode after obtaining an instruction ofentering the slow shutter photographing mode; continuously obtainingframes of images of a photographed object; dividing each frame of animage of the photographed object into a light trail region, a backgroundlight source region, and a non-light-source region according to a firstpreset brightness value; merging the light trail regions of the framesof the images of the photographed object; setting a merged light trailregion as a light trail region of a target image; setting backgroundlight source regions of one or more of the frames of the images of thephotographed object as a background light source region of the targetimage to avoid overexposure of the background light source region of thetarget image; merging non-light-source regions of one or more of theframes of the images of the photographed object; setting a mergednon-light-source region as a non-light-source region of the target imageto enhance brightness of the merged non-light-source region of thetarget image and avoid overexposure; and storing the target image afterobtaining a photographing instruction.
 2. The method according to claim1, wherein after continuously obtaining the frames of images of thephotographed object, and before dividing each frame of the image of thephotographed object, the method further comprises: obtaining brightnessof the frames of images of the photographed object; obtaining, accordingto the obtained brightness, a quantity of pixels whose brightness isgreater than or equal to a second preset brightness value in the imageof the photographed object when a value of a parameter needing to be setin the slow shutter photographing mode is not directly obtained;calculating, according to the quantity of the pixels whose brightness isgreater than or equal to the second preset brightness value and a totalquantity of pixels in the image of the photographed object, a percentagevalue of the pixel whose brightness is greater than or equal to thesecond preset brightness value; and adjusting, when the percentage valueis greater than or equal to an upper limit of a preset percentagethreshold, the value of the parameter needing to be set in the slowshutter photographing mode to reduce the percentage value such that thereduced percentage value in the image is within a range of the presetpercentage threshold.
 3. The method according to claim 1, wherein aftercontinuously obtaining the frames of the images of the photographedobject, and before dividing each frame of the image of the photographedobject, the method further comprises: obtaining brightness of the framesof the images of the photographed object; and adjusting, according to avalue of a parameter needing to be set in the slow shutter photographingmode, the parameter needing to be set in the slow shutter photographingmode when the value of the parameter needing to be set in the slowshutter photographing mode is directly obtained, wherein the value ofthe parameter needing to be set in the slow shutter photographing modeis set by a user according to the brightness of the frames of theimages.
 4. The method according to claim 1, wherein after merging thenon-light-source regions of one or more of the frames of the images ofthe photographed object, and setting the merged non-light-source regionas the non-light-source region of the target image, and wherein beforestoring the target image after obtaining the photographing instruction,the method further comprises performing brightness smoothing process onboundaries of the light trail region, the background light sourceregion, and the non-light-source region.
 5. The method according toclaim 1, wherein dividing each frame of the image of the photographedobject comprises dividing each frame of the image of the photographedobject into the light trail region, the background light source region,and the non-light-source region according to a difference degree of theimages at a same pixel location in the frames of the images of thephotographed object and the first preset brightness value.
 6. The methodaccording to claim 1, wherein merging the non-light-source regions ofone or more of the frames of the images of the photographed object, andsetting the merged non-light-source region comprises: merging thenon-light-source regions of a first N frames of images obtainedchronologically in the frames of the images of the photographed object;adding a brightness value of the merged non-light-source region (C) anda brightness value of the non-light-source region of an (N+1)^(th) frameobtained chronologically to obtain a brightness value (D); and settingthe merged non-light-source region of the first N frames of images asthe non-light-source region of the target image when the D is greaterthan or equal to the first preset brightness value, wherein N is apositive integer.
 7. A photographing method, comprising: entering a slowshutter photographing mode after obtaining an instruction of enteringthe slow shutter photographing mode; continuously obtaining frames ofimages of a photographed object; dividing each frame of an image of thephotographed object into a light trail region and a non-light-sourceregion according to a first preset brightness value; merging light trailregions of the frames of the images of the photographed object; settinga merged light trail region as a light trail region of a target image;merging non-light-source regions of one or more of the frames of theimages of the photographed object; setting a merged non-light-sourceregion as a non-light-source region of the target image to enhancebrightness of the merged non-light-source region of the target image andavoid overexposure; and storing the target image after obtaining aphotographing instruction.
 8. The method according to claim 7, whereinafter continuously obtaining the frames of the images of thephotographed object, and before dividing each frame of the image of thephotographed object, the method further comprises: obtaining brightnessof the frames of the images of the photographed object; obtaining,according to the obtained brightness, a quantity of pixels whosebrightness is greater than or equal to a second preset brightness valuein the image of the photographed object when a value of a parameterneeding to be set in the slow shutter photographing mode is not directlyobtained; calculating, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value; and adjusting, when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold, the value of the parameter needing to be set inthe slow shutter photographing mode to reduce the percentage value suchthat the reduced percentage value in the image is within a range of thepreset percentage threshold.
 9. The method according to claim 7, whereinafter continuously obtaining the frames of the images of thephotographed object, and before dividing each frame of the image of thephotographed object, the method further comprises: obtaining brightnessof the frames of the images of the photographed object; and adjusting,according to a value of a parameter needing to be set in the slowshutter photographing mode, the parameter needing to be set in the slowshutter photographing mode when the value of the parameter needing to beset in the slow shutter photographing mode is directly obtained, whereinthe value of the parameter needing to be set in the slow shutterphotographing mode is set by a user according to the brightness of theframes of the images.
 10. The method according to claim 7, whereinmerging the non-light-source regions of one or more of the frames of theimages of the photographed object, and setting the mergednon-light-source region comprises: merging the non-light-source regionsof a first N frames of images obtained chronologically in the frames ofthe images of the photographed object; adding a brightness value of themerged non-light-source region (C) and a brightness value of thenon-light-source region of an (N+1)^(th) frame obtained chronologicallyto obtain a brightness value (D); and setting the mergednon-light-source region of the first N frames of images as thenon-light-source region of the target image when the D is greater thanor equal to the first preset brightness value.
 11. A photographingmethod, comprising: entering a slow shutter photographing mode afterobtaining an instruction of entering the slow shutter photographingmode; continuously obtaining frames of images of a photographed object;dividing each frame of an image of the photographed object into a lighttrail region and a background light source region according to a firstpreset brightness value; merging the light trail regions of the framesof the images of the photographed object; setting a merged light trailregion as a light trail region of a target image; setting backgroundlight source regions of one or more of the frames of the images of thephotographed object as a background light source region of the targetimage to avoid overexposure of the background light source region of thetarget image; and storing the target image after obtaining aphotographing instruction.
 12. The method according to claim 11, whereinafter continuously obtaining the frames of the images of thephotographed object, and before dividing each frame of the image of thephotographed object, the method further comprises: obtaining brightnessof the frames of the images of the photographed object; obtaining,according to the obtained brightness, a quantity of pixels whosebrightness is greater than or equal to a second preset brightness valuein the image of the photographed object when a value of a parameterneeding to be set in the slow shutter photographing mode is not directlyobtained; calculating, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value; and adjusting, when thepercentage value is greater than or equal to an upper limit of a presetpercentage threshold, the value of the parameter needing to be set inthe slow shutter photographing mode to reduce the percentage value suchthat the reduced percentage value in the image is within a range of thepreset percentage threshold.
 13. The method according to claim 11,wherein adjusting the value of the parameter needing to be set in theslow shutter photographing mode comprises reducing a value of exposuretime and an International Organization for Standardization (ISO) valuewhen the percentage value is greater than or equal to the upper limit ofthe preset percentage threshold such that the reduced percentage valuein the image is within the range of the preset percentage threshold. 14.A photographing apparatus, comprising: a memory comprising instructions;and a processor coupled to the memory, wherein the instructions causethe processor to be configured to: obtain an instruction of entering aslow shutter photographing mode; continuously obtain frames of images ofa photographed object after the photographing apparatus enters the slowshutter photographing mode according to the instruction of entering theslow shutter photographing mode; divide each frame of an image of thephotographed object into a light trail region, a background light sourceregion, and a non-light-source region according to a first presetbrightness value; merge the light trail regions of the frames of theimages of the photographed object; set a merged light trail region as alight trail region of a target image; set background light sourceregions of one or more of the frames of the images of the photographedobject as a background light source region of the target image to avoidoverexposure of the background light source region of the target image;merge non-light-source regions of one or more of the frames of theimages of the photographed object; set a merged non-light-source regionas a non-light-source region of the target image to enhance brightnessof the merged non-light-source region of the target image and avoidoverexposure; and store the target image after obtaining a photographinginstruction.
 15. The photographing apparatus according to claim 14,wherein the instructions further cause the processor to be configuredto: obtain brightness of the frames of the images of the photographedobject; obtain, according to the brightness, a quantity of pixels whosebrightness is greater than or equal to a second preset brightness valuein the image of the photographed object when a value of a parameterneeding to be set in the slow shutter photographing mode is not directlyobtained; calculate, according to the quantity of the pixels whosebrightness is greater than or equal to the second preset brightnessvalue and a total quantity of pixels in the image of the photographedobject, a percentage value of the pixel whose brightness is greater thanor equal to the second preset brightness value; and adjust the value ofthe parameter needing to be set in the slow shutter photographing modeto reduce the percentage value such that the reduced percentage value inthe image is within a range of a preset percentage threshold when thepercentage value is greater than or equal to an upper limit of thepreset percentage threshold.
 16. The photographing apparatus accordingto claim 14, wherein when merging the non-light-source regions of one ormore of the frames of the images of the photographed object, and settingthe merged non-light-source region as the non-light-source region of thetarget image, the instructions further cause the processor to beconfigured to: merge the non-light-source regions of a first N frames ofthe images obtained chronologically in the frames of the images of thephotographed object; add a brightness value of the mergednon-light-source region (C) and a brightness value of thenon-light-source region of an (N+1)^(th) frame obtained chronologicallyto obtain a brightness value (D); and set the merged non-light-sourceregion of the first N frames of the images as the non-light-sourceregion of the target image when the D is greater than or equal to thefirst preset brightness value, wherein N is a positive integer.
 17. Aphotographing apparatus, comprising: a memory comprising instructions;and a processor coupled to the memory, wherein the instructions causethe processor to be configured to: obtain an instruction of entering aslow shutter photographing mode; continuously obtain frames of images ofa photographed object after the photographing apparatus enters the slowshutter photographing mode according to the instruction of entering theslow shutter photographing mode; divide each frame of an image of thephotographed object into a light trail region and a background lightsource region according to a first preset brightness value; merge thelight trail regions of the frames of the images of the photographedobject; set a merged light trail region as a light trail region of atarget image; set background light source regions of one or more of theframes of the images of the photographed object as a background lightsource region of the target image to avoid overexposure of thebackground light source region of the target image; and store the targetimage after obtaining a photographing instruction.
 18. The photographingapparatus according to claim 17, wherein the instructions further causethe processor to be configured to: obtain brightness of the frames ofthe images of the photographed object; obtain, according to thebrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in the image of thephotographed object when a value of a parameter needing to be set in theslow shutter photographing mode is not directly obtained; calculate,according to the quantity of the pixels whose brightness is greater thanor equal to the second preset brightness value and a total quantity ofpixels in the image of the photographed object, a percentage value ofthe pixel whose brightness is greater than or equal to the second presetbrightness value; and adjust the value of the parameter needing to beset in the slow shutter photographing mode to reduce the percentagevalue such that the reduced percentage value in the image is within arange of a preset percentage threshold when the percentage value isgreater than or equal to an upper limit of the preset percentagethreshold.
 19. A photographing apparatus, comprising: a memorycomprising instructions; and a processor coupled to the memory, whereinthe instructions cause the processor to be configured to: obtain aninstruction of entering a slow shutter photographing mode; adjust,according to brightness of frames of images of a photographed object, avalue of a parameter needing to be set in the slow shutter photographingmode to avoid overexposure of a target image after photographing; divideeach frame of an image of the photographed object into a light trailregion and a non-light-source region according to a first presetbrightness value; merge the light trail regions of the frames of theimages of the photographed object; set a merged light trail region as alight trail region of the target image; merge non-light-source regionsof one or more of the frames of the images of the photographed object;set a merged non-light-source region as a non-light-source region of thetarget image to enhance brightness of the merged non-light-source regionof the target image and avoid overexposure; and store the target imageafter obtaining a photographing instruction.
 20. The photographingapparatus according to claim 19, wherein the instructions further causethe processor to be configured to: obtain the brightness of the framesof the images of the photographed object; obtain, according tobrightness, a quantity of pixels whose brightness is greater than orequal to a second preset brightness value in the image of thephotographed object when the value of the parameter needing to be set inthe slow shutter photographing mode is not directly obtained; calculate,according to the quantity of the pixels whose brightness is greater thanor equal to the second preset brightness value and a total quantity ofpixels in the image of the photographed object, a percentage value ofthe pixel whose brightness is greater than or equal to the second presetbrightness value; and adjust the value of the parameter needing to beset in the slow shutter photographing mode to reduce the percentagevalue such that the reduced percentage value in the image is within arange of a preset percentage threshold when the percentage value isgreater than or equal to an upper limit of the preset percentagethreshold.